import frame from "@/views/main/frame.vue";
import home from "@/views/home/home.vue";
import my_absent from "@/views/absent/my.vue";
import sub_absent from "@/views/absent/sub.vue";
import inform_publish from "@/views/inform/publish.vue";
import inform_list from "@/views/inform/list.vue";
import inform_detail from "@/views/inform/detail.vue";
import staff_add from "@/views/staff/add.vue";
import staff_list from "@/views/staff/list.vue";
import absent_index from '@/views/absent/index.vue'
import inform_index from '@/views/inform/index.vue'
import staff_index from '@/views/staff/index.vue'
import {PermissionChoices} from "@/stores/auth.js";

const routes = [
    {
        path: '/',
        name: 'frame',
        component: frame,
        children: [
            {
                path: '/', name: 'home', component: home, meta: {
                    icon: "HomeField",
                    text: "首页",
                    permissions: [PermissionChoices.Staff],
                    opt: "|"
                },
            },
            {
                path: '/inform', name: "inform_index", component: inform_index, meta: {
                    icon: "Checked",
                    text: "通知管理",
                    permissions: [PermissionChoices.Staff],
                    opt: "|"
                },
                children: [
                    {
                        path: 'publish', name: 'inform_publish', component: inform_publish, meta: {
                            icon: "CirclePlusFilled",
                            text: "发布通知",
                            permissions: [PermissionChoices.Boarder, PermissionChoices.Leader],
                            opt: "|"
                        },
                    },
                    {
                        path: 'list', name: 'inform_list', component: inform_list, meta: {
                            icon: "List",
                            text: "通知列表",
                            permissions: [PermissionChoices.Staff],
                            opt: "|"
                        },
                    },
                    {
                        path: 'detail/:pk', name: 'inform_detail', component: inform_detail, meta: {
                            hidden: true,
                            permissions: [PermissionChoices.Staff],
                            opt: "|"
                        }
                    },
                ]
            },
            {
                path: '/absent', name: 'absent', component: absent_index, meta: {
                    icon: "Opportunity",
                    text: "考勤管理",
                    permissions: [PermissionChoices.Staff],
                    opt: "|"
                },
                children: [
                    {
                        path: 'my', name: 'my_absent', component: my_absent, meta: {
                            icon: "UserFilled",
                            text: "个人考勤",
                            permissions: [PermissionChoices.Staff],
                            opt: "|"
                        }
                    },
                    {
                        path: 'sub', name: 'sub_absent', component: sub_absent, meta: {
                            icon: "User",
                            text: "下属考勤",
                            permissions: [PermissionChoices.Boarder, PermissionChoices.Leader],
                            opt: "|"
                        }
                    },
                ]
            },
            {
                path: '/staff', name: "staff_index", component: staff_index, meta: {
                    icon: "Avatar",
                    text: "员工管理",
                    permissions: [PermissionChoices.Boarder, PermissionChoices.Leader],
                    opt: "|"
                },
                children: [
                    {
                        path: 'staffadd', name: 'staff_add', component: staff_add, meta: {
                            icon: "UserFilled",
                            text: "新增员工",
                            permissions: [PermissionChoices.Boarder, PermissionChoices.Leader],
                            opt: "|"
                        },
                    },
                    {
                        path: 'list', name: 'staff_list', component: staff_list, meta: {
                            icon: "CirclePlusFilled",
                            text: "员工列表",
                            permissions: [PermissionChoices.Boarder, PermissionChoices.Leader],
                            opt: "|"
                        },
                    },
                ]
            },
        ]
    },

]
export default routes;